package com.qijian.maindata.domain.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 生产进度->车间工序明细
 */

@Data
@ToString
public class ProcessOrderDetail4projectPerformanceVo {


    @JSONField
    @Excel(name = "开工令", sort = 1)
    private String projectMachineNo;

    @Excel(name = "项目名称", sort = 2)
    private String projectName;
    private String machineNo;
    @Excel(name = "项目经理", sort = 3)
    private String projectNickName;

    @Excel(name = "物料名称", sort = 4)
    private String itemName;

    @Excel(name = "归属车间", sort = 5)
    private String hrDept;

    @Excel(name = "管理人员所在车间", sort = 6)
    private String managerDeptName;

    @Excel(name = "作业人员所在车间", sort = 7)
    private String deptName;

    @Excel(name = "工单定额", sort = 8)
    private BigDecimal workCost;

    @Excel(name = "工序", sort = 9)
    private String processName;

    @Excel(name = "工单管理人", sort = 10)
    private String workNickName;

    @Excel(name = "工单工时", sort = 11)
    private BigDecimal workTime;
    @Excel(name = "计划完成", sort = 12, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date workEndTime;
    @Excel(name = "状态", sort = 13, defaultValue = "待派单")
    private String status;
    @Excel(name = "工单编号", sort = 14)
    private String workCode;

    @Excel(name = "作业人员", sort = 15)
    private String userNickName;
    @Excel(name = "实际工时", sort = 16)
    private BigDecimal actualTimes;

    private BigDecimal times;
    @Excel(name = "实际定额", sort = 17)
    private BigDecimal prices;


    @JsonSerialize(using = ToStringSerializer.class)
    private Long wuId;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long workId;

    private Date createTime;

    private Date checkTime;
    private Integer checkVal;


    private String workType;
    private String ncrCode;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long processId;

    private String projectNo;

    private Date updateTime;
    private Integer level;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long bomId;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long projectId;

    private String dispatchTime;

    private Boolean isOut;

    // 车间名
    private String factoryName;

    @ApiModelProperty(value = "接单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date receiveTime;


    @ApiModelProperty(value = "报工时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date reportTime;

    @ApiModelProperty(value = "系统工时")
    private Integer orderHours;

    private String processTypeName;


    public String getProjectMachineNo() {
        return String.format("%s(%s#)", projectNo, machineNo);
    }
}
